﻿using System;
using System.Windows;
using Hardcodet.Wpf.TaskbarNotification;

namespace CleanBackup.View
{
	/// <summary>
	/// Interaktionslogik für Window.xaml
	/// </summary>
	public partial class MainWindow : Window
	{
		TaskbarIcon tbi = new TaskbarIcon();

		public MainWindow()
		{
			InitializeComponent();

			tbi.Icon = new System.Drawing.Icon("../../Ressources/Images/HardDisk.ico");
			tbi.ToolTipText = "CleanBackup";
			tbi.TrayLeftMouseUp += new RoutedEventHandler(tbi_TrayLeftMouseUp);
		}

		void tbi_TrayLeftMouseUp(object sender, RoutedEventArgs e)
		{
			Show();
		}

		private void Window_StateChanged(object sender, EventArgs e)
		{
			if (WindowState == WindowState.Minimized)
			{
				Hide();
				tbi.ShowBalloonTip("CleanBackup", "", tbi.Icon);
			}
		}
	}
}
